

use common::app_config::Config;
use common::db;
use mongodb::bson::{Document, doc};


fn main() {
    println!("Hello, world!");

    log4rs::init_file("./conf/log4rs.yaml", Default::default()).unwrap();

    let app_config_path = "./conf/app.yaml";
    let appconfig:Config = Config::init(app_config_path);
    println!("{:?}", appconfig);
    println!("{:?}", appconfig.mongodb.db_name);

    let db1 = db::DB::init_db(appconfig.mongodb.db_url, appconfig.mongodb.db_name).unwrap();

    let docs = db1.find_kline_by_filter(doc!{}).unwrap();

    for doc in docs {
        println!("doc: {:?}", doc);
    }

}
